﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Lamex.mIE.Calculate
{
    public class LGC_TIM_D42_SAW
    {
        public static bool LGC_TIM_D42_SAW_VALUES(string Part_No)
        {
            bool result = false;
            //获取工艺路线
            DataTable dtRoutingListTemp = Common.GetDWG_List.Dwg_List("IE_Part_Routing R JOIN IE_Routing_Combination C ON R.GROUP_CODE=C.GROUP_CODE",
             "C.ROUTING_CODE",
             "and R.PART_NO='" + Part_No + "'");
            string[] strROUTING_CODE = dtRoutingListTemp.Rows[0]["ROUTING_CODE"].ToString().Split('_');
            if (strROUTING_CODE.Length > 0)
            {
                //前面工序包含D34,返回true
                if (strROUTING_CODE.Contains("D34"))
                {
                    result = true;
                    return result;
                }
                for (int i = 0; i < strROUTING_CODE.Length; i++)
                {
                    string strProcess = strROUTING_CODE[i];
                    //获取工序的特征
                    DataTable dataTable = Common.GetDWG_List.Dwg_List("IE_WorkCenter_Feature",
                 "FEATURE_NAME",
                 "and PROCESS_CODE='" + strProcess + "'");
                    if (dataTable.Rows.Count > 0)
                    {
                        for (int j = 0; j < dataTable.Rows.Count; j++)
                        {
                            if (dataTable.Rows[j]["FEATURE_NAME"].ToString() == "Dxx_洗板材_手工")
                            {
                                result = true;
                                break;
                            }
                        }
                    }
                }
            }

            return result;
        }
    }
}
